﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using MoneyManagerNET.Presentation.ViewModel.Base;
using Mvvm.Infrastructure;

namespace MoneyManagerNET.Presentation.ViewModel
{
    public class ViewModel2ViewConverter:IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var vm = value as ViewModelBase;
            if (vm != null)
                return ViewLocator.Locate(vm);
            else
                return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
